import * as THREE from '../../../../modules/three/three.module.js'
import RoutePointVO from "../../model/RoutePointVO.js";
import RouteVO from "../../model/RouteVO.js";

export default class World3dEvent {
  // b3dms 瓦片文件加载完成事件
  static modelLoaded = {
    type: 'model loaded',
    tile: '3d模型文件加载完毕',
    langKey: '3dModelLoaded',
    value: {},
  }
  // 相机焦点选中事件
  static cameraTargetSelected = {
    type: 'camera target selected',
    tile: '相机焦点的坐标',
    langKey: 'camaraFocusPos',
    value: new THREE.Vector3(),
  }
  //视角指示器选中事件
  static eyeIndicatorSelected = {
    type: 'eye indicator selected',
    tile: '选中的视角',
    langKey: 'selectedView',
    value: {
      pos: new THREE.Vector3(),
      target: new THREE.Vector3(),
      id: -1,
      distance: 2.0,
    }
  }
  // 工作区选中事件
  static workAreaSelected = {
    type: 'work area selected',
    tile: '选中的喷涂工作区',
    langKey: 'selectWorkArea',
    value: {
      color: '#ff6000',
      areaName: '',
      fromSurface: false,
    }
  }
  // 不规则曲面工作区选中事件
  static surfaceAreaSelected = {
    type: 'surface area selected',
    tile: '选中的曲面喷涂工作区',
    langKey: 'selectSurfaceArea',
    value: {
      color: '#ff6000',
      areaName: '',
    }
  }
  // 喷涂航线选中事件
  static sprayPathSelected = {
    type: 'spray path selected',
    tile: '选中的喷涂航线',
    langKey: 'selectSprayPath',
    value: {
      color: '#ff6000',
    }
  }
  // 清空3d对象的属性面板 事件
  static clearPaneSelection = {
    type: 'none',
    title: '',
    langKey: 'noneSelect'
  }
  static clearEditorState = {
    type: 'clearEditorState',
    title: '重置编辑器状态',
    langKey: 'clearEditorState'
  }
  // 视角列表改变事件
  static eyeIndicatorsChanged = {
    type: 'eye indicator changed',
    tile: '全部视角',
    langKey: 'allFixedEyes'
  }
  // edit 数据保存到 localStorage
  static editDataSave = {
    type: 'save to localStorage',
    tile: 'edit data save',
    langKey: 'saveComplete',
    value: {
      success: true,
      info: 'edit data saved to localStorage',
    }
  }
  // 之前保存的编辑加载完毕
  static editDataLoaded = {
    type: 'edit data loaded',
    tile: '3d编辑数据加载完毕',
    langKey: 'edit data loaded',
    value: {},
  }
  // 图形自相交了
  static contourSelfIntersected = {
    type: 'contour self intersected',
    tile: '',
    langKey: 'noSelfIntersectionHoleInfo'
  }
  // 航点选中事件
  static routePointSelected = {
    type: 'route point selected',
    tile: '',
    langKey: 'routePointSelected',
    value: {
      vo: new RoutePointVO(),
    },
  };
  // 整条航线的选中事件
  static routeSelected = {
    type: 'route selected',
    tile: '',
    langKey: 'routeSelected',
    value: {
      vo: new RouteVO(),
    },
  };
}
